#ifndef CVLOGINDIALOG_H
#define CVLOGINDIALOG_H

#include <QDialog>
#include <QIcon>
#include <QImage>
#include <QPixmap>
#include <QMovie>
#include <QtNetwork/QNetworkReply>

#include "model/cvuser.h"

namespace Ui {
class CVLoginDialog;
}

class CVLoginDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit CVLoginDialog(QWidget *parent = 0);
    ~CVLoginDialog();

private slots:
    void validateNetwork(QFocusEvent *e);
    void validatedNetwork(bool result);
    void validateLoginAction(bool result, const QString &msg, QNetworkReply::NetworkError error);

    void loginAction();
    void handleUserSlot(CVUser *user, const QString &msg);
private:
    Ui::CVLoginDialog *ui;
    QMovie *loading;
};

#endif // CVLOGINDIALOG_H
